#! /usr/bin/python
# -*- coding: utf-8 -*-

from google.appengine.ext import db

class UploadImage(db.Model):
    imgid = db.IntegerProperty()
    contentType = db.StringProperty(multiline=False)
    imgdata = db.BlobProperty()
    createdTime = db.DateTimeProperty(auto_now_add=True)

def getImageById(imgId):
    q = db.GqlQuery("SELECT * FROM UploadImage WHERE imgid = :imgid", imgid=imgId)
    imageModel = q.get()
    return imageModel
